package com.tinckay.entity.po;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;

import com.tinckay.common.constant.ProjectConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;

/**
 * <p>
 *
 * </p>
 *
 * @author Jean
 * @since 2018-10-21
 */
@Data
@Accessors(chain = true)
@TableName("pour_vehicle")
@ApiModel(value = "Vehicle对象", description = "车辆信息")
public class Vehicle extends Model<Vehicle> {

    private static final long serialVersionUID = 408923700264107815L;

    @TableId(value = "id", type = IdType.AUTO)
    @NotNull(message = "id不能为空", groups = ProjectConstant.Update.class)
    private Long id;

    @ApiModelProperty(value = "用户id")
    private Long userId;

    @ApiModelProperty(value = "车牌号码")
    private String vehNo;

    @ApiModelProperty(value = "车辆方量")
    private Double vehSquare;

    @ApiModelProperty(value = "车辆类型")
    private Integer vehType;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间", hidden = false)
    private LocalDateTime dataTime;

    @ApiModelProperty(value = "DB创建时间", hidden = true)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间", hidden = true)
    private LocalDateTime updateTime;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
